

mylist = ["qwe","asd","zxc"]

#1.1  查找元素索引值
index = mylist.index("zxc")
print(index)

#2修改特定小标索引的值
mylist[0] = "wer"
print(mylist[0])

#3在指定下标位置插入新元素
mylist.insert(1,"qwe")
print(mylist)

#4在列表尾部添加 单个 新元素
mylist.append("xvx")
print(mylist)

#5在列表尾部添加 多个 新元素
mylist.extend(["a","b","c"])
print(mylist)

#6删除指定下标元素

#6.1
del mylist[0]
print(mylist)

#6.2
element = mylist.pop(0)
print(mylist)
print(element)

#7删除某元素在列表中的第一个匹配项
mylist.remove("zxc")
print(mylist)

#8清空列表
mylist.clear()
print(mylist)

#9统计列表内某元素的数量
mylist = ["qwe","asd","zxc","zxc"]
count = mylist.count("zxc")
print(count)

#10统计列表内所有元素数量
len = len(mylist)
print(len)